public class demo8 {
    public static void main(String[] args) {
        //敏感词
        //1 获取到说的话
        String talk = "你玩的真好，以后不要玩了，TMD,CNM";

        //建立一个敏感词库
        String[] arr={"CNM","TMD","SB","MLGB"};
        //将敏感词进行一个替换

        for (int i = 0; i < arr.length; i++) {
             talk = talk.replace(arr[i], "***");
        }
        //String result = talk.replace("TMD", "***");
        System.out.println(talk);
    }
}
